package com.gxa.p2p.service.impl;

import com.gxa.p2p.mapper.MarkTypeMapper;
import com.gxa.p2p.pojo.Markclass;
import com.gxa.p2p.service.MarkTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Bei
 * @date 2021/10/27 18:13
 */
@Service
@Transactional(rollbackFor = Throwable.class)
public class MarkTypeServiceImpl implements MarkTypeService {

    @Autowired
    MarkTypeMapper markTypeMapper = null;

    @Override
    public List<Markclass> findAll(Integer page,Integer size) {
        List<Markclass> all = markTypeMapper.findAll((page - 1) * size, size);
        return all;
    }

    @Override
    public Integer findAll() {
        Integer allCount = markTypeMapper.findAllCount();
        return allCount;
    }

    @Override
    public void addMarkType(Markclass markclass) {
        markTypeMapper.addMarkType(markclass);
    }

    @Override
    public void updateMarkType(Markclass markclass) {
        markTypeMapper.updateMarkType(markclass);
    }
}
